Page({
  onShareAppMessage() {
    return {
      title: 'input',
      path: 'packageComponent/pages/form/input/input'
    }
  },

  data: {
    schema: [{
      label:'输入框类型',
      prop:'type',
      type:'picker',
      valueOptions:['text','number','idcard','digit','safe-password','nickname'],
      labelOptions:['文本','整数','身份证','小数','密码','昵称']
    },{
      label:'是否密码',
      prop:'password',
      type:'switch'
    },{
      label:'占位文本',
      prop:'placeholder',
      type:'text'
    },{
      label:'是否禁用',
      prop:'disabled',
      type:'switch'
    },{
      label:'最大输入长度',
      prop:'maxlength',
      type:'number'
    },{
      label:'光标与键盘的距离',
      prop:'cursorSpacing',
      type:'number'
    },{
      label:'获取焦点',
      prop:'focus',
      type:'switch'
    },{
      label:'键盘确认文字',
      prop:'confirmType',
      type:'picker',
      valueOptions:['send','search','next','go','done'],
      labelOptions:['发送','搜索','下一个','前往','完成']
    },{
      label:'光标位置',
      prop:'cursor',
      type:'number'
    },{
      label:'光标颜色',
      prop:'cursorColor',
      type:'text'
    }],
    formData: {
      type:'text',
      password:false,
      placeholder:'请输入',
      disabled:false,
      maxlength:140,
      cursorSpacing:0,
      focus:false,
      confirmType:'done',
      cursor:0,
      cursorColor:'#000000'
    },
    value:'',
    title: '',
    result: '',
    zh:'',
    apiType: '',
    remark: '',
    webUrl: '',
    apiName: '',
  },
  onLoad(options) {
    this.setData({
      apiType: options.zh,
      title: options.title,
      zh: options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
  },
  getFormData(e){
    this.setData({
      formData:e.detail.formData
    })
  }
})
